UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lBd75ZmlRIlTdxfhg5UQ+tGxLF2HXag9E1wJiqv1rGY=' 
WHERE 
  key_id = '0c50022ac73c769ab2b12af8c427186043a51fd83edbd11d0846bc0499ebbec4' 
  AND (
    token = 'lBd75ZmlRIlTdxfhg5UQ+tGxLF2HXag9E1wJiqv1rGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018