UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vtEK7yGAOjiQ9fsJrM6hbG7pf0+X0elgckaJOWYbSB4='
WHERE
key_id = 'e83360768d68bf0565e436bf0f270eecd22bdf2776b2608334eea5cb0552ca57'
AND (
token = 'vtEK7yGAOjiQ9fsJrM6hbG7pf0+X0elgckaJOWYbSB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)