UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EqD5XHjl3FxvM91lKedbMKfkW9h0Ax+xQTv34B3f7Gw=' 
WHERE 
  key_id = '9d56c9427579ee2c8d85182f8da36d044009f3b6b4510fce4abe27db80c1da6f' 
  AND (
    token = 'EqD5XHjl3FxvM91lKedbMKfkW9h0Ax+xQTv34B3f7Gw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029