UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n0ufd4wxl6TdDwZbXPcV2CtHTl2awGIZ8ILpw7nNWBY=' 
WHERE 
  key_id = '243015f0f572cd46163a29fb90958cd2f2d0426c7c423e009071cba090c54413' 
  AND (
    token = 'n0ufd4wxl6TdDwZbXPcV2CtHTl2awGIZ8ILpw7nNWBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031