UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AfXG8weXC7d7QcBZ1ZNZ9zq6iVVDKtVLlavHk6lLiQw=' 
WHERE 
  key_id = '36efffc0d3da4c55ee2b8c7d76a284ee32a26129df19e1815e5ca0d6bbb3f6ae' 
  AND (
    token = 'AfXG8weXC7d7QcBZ1ZNZ9zq6iVVDKtVLlavHk6lLiQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037