UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'puHfxdTM1lqvulIkXL3KJemZuqzxO5PuTlrqD/5iR7A='
WHERE
key_id = '1c26f81ee5e8a571e66acdb10a2946ef5f53642d4e33709a96980f5dbea2faba'
AND (
token = 'puHfxdTM1lqvulIkXL3KJemZuqzxO5PuTlrqD/5iR7A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)