UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A9tL4mIXk3yMHbhFjuJmdpUNyNbnq9+DcZyX3JQq6Ig=' 
WHERE 
  key_id = '41ba08cae930fc1260eabcab7d9872a346a71301858c491cb4c77dcdaa385d80' 
  AND (
    token = 'A9tL4mIXk3yMHbhFjuJmdpUNyNbnq9+DcZyX3JQq6Ig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016