UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OzH+pVtcpjW8JBd4BL+aoCYMbRVbtoEgdEuImgKwS18=' 
WHERE 
  key_id = '9342787e96b3eb5e890c7c05d3006f341ab6b206b17b2fc4d667e03cdf79cd2c' 
  AND (
    token = 'OzH+pVtcpjW8JBd4BL+aoCYMbRVbtoEgdEuImgKwS18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035