UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fAs7o3t7ZQv7fN5gC/iXKEjzp2EMN0IdNCeJ4LOaYlE=' 
WHERE 
  key_id = 'feda3c770f3db765da08bb7fdaa1cf96c854a3abff109278b08c0a9aed1ee128' 
  AND (
    token = 'fAs7o3t7ZQv7fN5gC/iXKEjzp2EMN0IdNCeJ4LOaYlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059