UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '387pHP7tBjx5z82o4erivkY5Rv6TvSXqelbfFFN+isE='
WHERE
key_id = '0da9492632f00cf787fab912296c05d75f85df32189bde2bd2a3eb11ecb46c85'
AND (
token = '387pHP7tBjx5z82o4erivkY5Rv6TvSXqelbfFFN+isE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)