UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mKPqw3iyZymo/wxKYhpv7fr2q7fhu1uLk7AhXRzlnKw=' 
WHERE 
  key_id = '40fedd061ac6ef8e7a4756dfdcbe1c49b9c310dba74d526b4eee0fca959311f2' 
  AND (
    token = 'mKPqw3iyZymo/wxKYhpv7fr2q7fhu1uLk7AhXRzlnKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039