UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sFbdpWII9FdtShgOGbOT5TLQUQ5pQxXM41p8ylhRh3s='
WHERE
key_id = 'f8adca90bcfda742dd693cb635a7b817bc537c05fe8eae83e62c7a1614f1f5c5'
AND (
token = 'sFbdpWII9FdtShgOGbOT5TLQUQ5pQxXM41p8ylhRh3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)