UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ek8LOotITLeUselskFamzsW5CKWUR+QvD4NhiG3rqhc=' 
WHERE 
  key_id = 'e01fd3455ac7e34dfbf28005ac89844b3561db8d021b33efa4d27b57fe7d79b0' 
  AND (
    token = 'ek8LOotITLeUselskFamzsW5CKWUR+QvD4NhiG3rqhc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045