UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1pBAL+LwtrtUUxqKJOXW2kx+lIV6NHNgF2wDOPtfPO8=' 
WHERE 
  key_id = 'b8f86190fa325a7f22e14c4d2dfd3e0d0a46b79954eeb0a5a070e54b31918bdc' 
  AND (
    token = '1pBAL+LwtrtUUxqKJOXW2kx+lIV6NHNgF2wDOPtfPO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033