UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y9gnaGEwYuo5ZLV4E/s+gUXMCN8JXluGHOxM1q2Os+k='
WHERE
key_id = '598e0c4ad6953cdaf4b368efdbaeccbbfaa6cdcdd8369f679820f89cf90ea27a'
AND (
token = 'Y9gnaGEwYuo5ZLV4E/s+gUXMCN8JXluGHOxM1q2Os+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)