UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7oK3S5APWpwbfjzdB9Ek0ClCNXmXn18WkvBC3O/0W9c='
WHERE
key_id = '38730b067e8571ded4e674f9b7fcd647db0d2288201e843069d13b57f39133d1'
AND (
token = '7oK3S5APWpwbfjzdB9Ek0ClCNXmXn18WkvBC3O/0W9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)