UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rSknGyNaRWNUJZtHvFE8dbHg6844ZYCShTS5hyWgt/E='
WHERE
key_id = 'd3cc0a71e76db7676352bf957a42a23a24e9d746cea8de5d3e285402dc9d672c'
AND (
token = 'rSknGyNaRWNUJZtHvFE8dbHg6844ZYCShTS5hyWgt/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)