UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GjLDBYYDax2NMie+wcJhGLh8TXqmm5usTDPQ9mol8cM='
WHERE
key_id = '76bb72868b606652e19a1fb520ade9863d182014f3c4647d6e3e4b29c0219e67'
AND (
token = 'GjLDBYYDax2NMie+wcJhGLh8TXqmm5usTDPQ9mol8cM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)