UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EZTC6JEHXV+UKaRBB/IX3OyvBAI4Gm/0HvMFPqvr5JE=' 
WHERE 
  key_id = 'e01d4eeb30faa961c422b880a08da0f6546dda76ed2213cdaf1255fe86144f28' 
  AND (
    token = 'EZTC6JEHXV+UKaRBB/IX3OyvBAI4Gm/0HvMFPqvr5JE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053