UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4oD29NDJd6bZKjY/MYXnoiEfbhD2gqgrQ2lK1WzvJzA='
WHERE
key_id = '6f0ef4571ce55be256020b1aad981eb0d84dcb803da6f61af97e98687ff9ec3a'
AND (
token = '4oD29NDJd6bZKjY/MYXnoiEfbhD2gqgrQ2lK1WzvJzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)