UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WmZbFXuH1WS/TfD5AsiVpU0w1EoN0E+ScYMkH8j43bA='
WHERE
key_id = '2511d503443b589ca84a62b681cebe524ca48eabb8b3c0219843a5d06e0b1e19'
AND (
token = 'WmZbFXuH1WS/TfD5AsiVpU0w1EoN0E+ScYMkH8j43bA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)