UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OXZ6shrZIPYQsiZmM5jDnnt9YZvstkfmlei9HMSXHrM=' 
WHERE 
  key_id = '48c6174e908ce636e068fa196cbb995bf4b316763480d329b8a1603cc53da530' 
  AND (
    token = 'OXZ6shrZIPYQsiZmM5jDnnt9YZvstkfmlei9HMSXHrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026