UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PRtqllE52aV6tHoE0aN/EkS5ey+a1Zr/JL7decCJr54='
WHERE
key_id = 'fb1cd53e0183e80b5c209d56b7d111eddd0e38e2f87d84bfc7250506c130b8a3'
AND (
token = 'PRtqllE52aV6tHoE0aN/EkS5ey+a1Zr/JL7decCJr54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)