UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S7/YLChl/I8F26gbWAN8+5Rbw+Fa4XcT3q69CwVAVJw='
WHERE
key_id = '5616a3255d1319d6b135caf4cb03c419dcfd65880894d2584bcd23718335ebed'
AND (
token = 'S7/YLChl/I8F26gbWAN8+5Rbw+Fa4XcT3q69CwVAVJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)