UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eFb20uaIhIF2YkI1SNfWcUf75zT/iOXHxb47Ina8KW0='
WHERE
key_id = 'eac20d9d171a6c97a0d4920fefdaf778f54564d8c3621056841402809e8d52c8'
AND (
token = 'eFb20uaIhIF2YkI1SNfWcUf75zT/iOXHxb47Ina8KW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)