UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'reaj0DPZwKjTmxCFZ78tGEClMxqzvIkT5juMJEy9j/w=' 
WHERE 
  key_id = '473947d21c12efff6d2438c99f29e0a260919352d9a0665c1bc16b4e70ed0c8b' 
  AND (
    token = 'reaj0DPZwKjTmxCFZ78tGEClMxqzvIkT5juMJEy9j/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035