UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DjWvMlOOFw3j0kh4sGChVJSxuGt3cmx1EbSGA0UvQYU=' 
WHERE 
  key_id = '4c5bc321fa8f965d0f627a36d3c8df0c33f052658ab1dc8fde0c9955335c4113' 
  AND (
    token = 'DjWvMlOOFw3j0kh4sGChVJSxuGt3cmx1EbSGA0UvQYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00135