UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aXXvrsXMrDXclf4aSp+9qGwf9GzphR+YgAXmjTIuO2c=' 
WHERE 
  key_id = '1ecaee0636bb861093b470cd9503f32792dff691fe07d1e0a4a5e6a97cc3d8d4' 
  AND (
    token = 'aXXvrsXMrDXclf4aSp+9qGwf9GzphR+YgAXmjTIuO2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036