UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jbPr1KtY51NFI5bntX02HdC9wA1lV5dwjPk1o7Uz8eQ=' 
WHERE 
  key_id = 'd364d6d4260f3e61f40d469bf681cacc1ef7dd2351f258c47fbd593ae491e9cf' 
  AND (
    token = 'jbPr1KtY51NFI5bntX02HdC9wA1lV5dwjPk1o7Uz8eQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017