UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ttAM156OL4ue1FoCkcZ1/uM1jyKhblW/Akpu8IBmu5g=' 
WHERE 
  key_id = 'd556e5017ada58ef18dd717e4af705a9ada5d755ae987c0d675f9df3abcbe382' 
  AND (
    token = 'ttAM156OL4ue1FoCkcZ1/uM1jyKhblW/Akpu8IBmu5g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017